<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改资助')" />
    <th:block th:include="include :: datetimepicker-css" />
    <th:block th:include="include :: select2-css"/>
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-grant-edit" th:object="${stbGrant}">
            <input name="grantId" th:field="*{grantId}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">所属企业：</label>
                <div class="col-sm-8">
                    <select name="compId" class="form-control m-b" required  th:field="*{compId}">
                        <option value="">--请选择--</option>
                        <option  th:each="a:${companyList}" th:text="${a.compName}"
                        th:value="${a.compId}" th:selected="${compId eq a.compId}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">资助金额(万元)：</label>
                <div class="col-sm-8">
                    <input name="grantMoney" th:field="*{grantMoney}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">资助原因：</label>
                <div class="col-sm-8">
                    <textarea name="grantReason" class="form-control">[[*{grantReason}]]</textarea>
                </div>
            </div>
           <!--  <div class="form-group">    
                <label class="col-sm-3 control-label">资助类型：</label>
                <div class="col-sm-8">
                    <select name="grantType" class="form-control m-b">
                        <option value="">--请选择--</option>
                    </select>
                </div>
            </div> -->
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">资助时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        <input name="getTime" th:value="${#dates.format(stbGrant.getTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                       <textarea type="text" name="remark" class="form-control" placeholder="请输入备注"></textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <th:block th:include="include :: select2-js"/>
    <script type="text/javascript">
        var prefix = ctx + "system/grant";
        $("#form-grant-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-grant-edit').serialize());
            }
        }

        $("input[name='getTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>